<%--
 *  File:    CompanyMultiSelectPop.jsp
 *  @Author: Kent Zhong 
 *  Date:    2002/04/23
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
 

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom-tag.tld" prefix="custom" %>
 

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.CompanyMultiSelectPop");  
%>

<% //--------------------------------------  variant and initialization --%>
<%
	String strModuleName = "BIEE";
  	String strTableName = "ovorg";
  	
  	//get current userinfo
  	HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
  	cat.debug("The userinfo is :"+CurUserInfo);
  	cat.info("enter my page");
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>Add</title>
<PageFlow:CheckPageFlow pageName="forumorgselect"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<script language="JavaScript" >

    function page_summary(actionvalue,orderbyname)
	{
	  var editform = summaryPrepare(orgselectform,actionvalue,orderbyname);
	  editform.action = "CompanyMultiSelectPop.jsp?<%= OvalTools.randomURL() %>";
	  editform.target = "_self";
	  isRunning = true;
	  editform.submit();  
	}
	
    function checkbox_Click(selectid)
    {
        var obj=eval("document.orgselectform."+ selectid);
        if(obj.checked)
	        obj.checked=true;
	    else
	        obj.checked=false;  
        
    }
    
    function page_close()
    {
        var strOrgList="";
        for(var i=0;i<document.orgselectform.length;i++)
        {
            if(document.orgselectform[i].name=="orgcode" )
            {
                if(document.orgselectform[i].checked)
                {
                    if(!isEmpty(strOrgList))
                        strOrgList+=",";
                    strOrgList+=document.orgselectform[i].value;
                }
            }
            
        }
        
        opener.setParent( strOrgList);
        window.close();
        
    }
<%--[SCRIPT]    [SCRIPT]--%>
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="orgselectform" method="post" action="../Dispatcher"  target="_parent">
    <input type="hidden" name="pagename" value="forumorgselect">
    <input type="hidden" name="actionname">
    <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    <oval:hidden property="orgselectopt"/>
<table width="100%" cellspacing="0" cellpadding="0" height="100%">
    <tr> 
      <td valign="top"> 
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
            <%@ include file="/inc/SummarySearch.inc" %>
          </tr>
        </table>
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        
          <tr class="deepblue-left" > 
            <td class="title_center" width="5%" >&nbsp;</td>
            <td class="title_center" width="12%"><%=label.getLabelName("L_OrgCode")%></td>
            <td class="title_center"><%=label.getLabelName("L_OrgName")%></td>
            <td class="title_center" width="12%"><%=label.getLabelName("L_SCMRole")%></td>
          </tr>
          <%
            cat.info("start loop");
            Vector orgsummary=(Vector)pageContext.getAttribute("orgsummary");
            if(orgsummary==null)
            {
                orgsummary=new Vector();
            }
            cat.debug("orgsummary is :"+orgsummary);
            
            String strClassType = new String("");   
            int i=0;
           
          %>
          <logic:iterate id="allrelationorgitem" collection="<%= orgsummary %>">
            <%
            if(i%2 == 1)
            {
              strClassType = "td-listrom";
            }else{                    
              strClassType = "none";
            }
            
            i++;
          %>  
          <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull(strClassType)%>'"  class="<%=JspHelper.filterNull(strClassType)%>" onClick="javascript:checkbox_Click('orgid<%=JspHelper.filterNull(i)%>');"> 
            <td>
              <input id="orgid<%=JspHelper.filterNull(i)%>" type="checkbox" name="orgcode" value='<oval:write name="allrelationorgitem" property="orgcode"/>' class="checkbox">
            </td>
            <td>&nbsp;<oval:write name="allrelationorgitem" property="orgcode"/></td>
            
            <td>&nbsp;<oval:write name="allrelationorgitem" property="shortname"/></td>
            <td>&nbsp;<oval:write name="allrelationorgitem" property="pccodename"/></td>
          </tr>
          </logic:iterate>
          <%cat.info("end loop");%>
          <tr> 
            <td colspan="4"> 
            <table width="100%" cellspacing="0" border="0">
              <%@ include file="/inc/SummaryActionPop.inc" %>
            </table>  
            </td>
          </tr>
        
      </table>
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
          <tr> 
            
          <td class="td_center">
            <a onclick="page_close()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a></td>
          </tr>
        </table>
      </td>
    </tr>
</table>
</form>
</body>
</html>


